package com.atguigu.lease.common.springmvc;

import com.atguigu.lease.common.result.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * projectName: com.atguigu.lease.common.springmvc
 *
 * @author: 吴振鹏
 * description:
 * time: 2025/7/8 14:46
 */
@RestControllerAdvice
public class GlobalExceptionHandlers {

    @ExceptionHandler(Exception.class)
    public Result<String> handlerException(Exception e) {
        e.printStackTrace();
        return Result.fail(e.getMessage());
    }

    public Result<String> leaseException(LeaseException e) {
        e.printStackTrace();
        return Result.fail(e.getMessage());
    }




}
